From d498f2f85c5acac22c30f6425dcd1d2efe6aa9e5 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sun, 2 Mar 2014 01:50:07 +0100 Subject: [PATCH] lisp/icomplete.el (icomplete-completions): Use string-width. Suggested by Stefan Monier . --- lisp/ChangeLog | 5 +++++ lisp/icomplete.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a22f88a48db..ea8a3ada8f9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-03-02 Juanma Barranquero + + * icomplete.el (icomplete-completions): Use string-width. + Suggested by Stefan Monier . + 2014-03-01 Dmitry Gutov * progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight diff --git a/lisp/icomplete.el b/lisp/icomplete.el index e3f7fde7797..626d63914d8 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -403,14 +403,14 @@ matches exist." (substring most compare)) ;; Don't bother truncating if it doesn't gain ;; us at least 2 columns. - ((< compare (+ 2 (length ellipsis))) most) + ((< compare (+ 2 (string-width ellipsis))) most) (t (concat ellipsis (substring most compare)))) close-bracket))) ;;"-prospects" - more than one candidate (prospects-len (+ (string-width (or determ (concat open-bracket close-bracket))) (string-width icomplete-separator) - (+ 2 (length ellipsis)) ;; take {…} into account + (+ 2 (string-width ellipsis)) ;; take {…} into account (string-width (buffer-string)))) (prospects-max ;; Max total length to use, including the minibuffer content. -- 2.30.2